<?php
/**
 * 商品标签
 * User: ws
 * Date: 2018/8/9
 * Time: 14:50
 */

namespace app\admin\model;
use think\Model;

class GoodsLabel extends Model
{
    function add($params){
        $result = $this->isUpdate(false)->setAttr('goods_label_id',null)->allowField(true)->save($params);
        if($result){
            return 1;
        }else{
            return false;
        }
    }
    function edit($params)
    {
        $result = $this->isUpdate(true)->allowField(true)->save($params);
        if($result){
            return true;
        }else{
            return false;
        }
    }
}